<template>
    <div class="article-view">
      <div v-html="articleContent"></div>
      <router-link to="/">Back to Home</router-link> <!-- 返回主页的链接 -->
    </div>
  </template>
  
  <script>
  import { marked } from 'marked';
  
  export default {
    props: ['filename'],
    data() {
      return {
        articleContent: '',
      };
    },
    async mounted() {
      const response = await fetch(`./markdown/${this.filename}`);
      const markdown = await response.text();
      this.articleContent = marked(markdown);
    },
  };
  </script>
  
  <style scoped>
  /* Your styles here */
  </style>
  